package com.cssy.yd.logic.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.yd.logic.dao.LogicProSuggestItemDAO;
import com.cssy.yd.logic.entity.LogicProSuggestItemDO;
import com.cssy.yd.logic.service.ILogicProSuggestService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.yuendong.sy.service.code.impl.SyCodeService;

@Service("logicProSuggestService")
public class LogicProSuggestServiceImpl implements ILogicProSuggestService {

	private static final Logger logger = Logger.getLogger(LogicProSuggestServiceImpl.class);

	@Resource(name = "logicProSuggestItemDAO")
	private LogicProSuggestItemDAO logicProSuggestItemDAO;

	

	@Resource(name = "syCodeService")
	private SyCodeService syCodeService;

	@Override
	public SearchResult findListByExample(SearchConditions scs)throws SyBaseException {
		SearchResult rs = new SearchResult(scs);
		rs.setResults(logicProSuggestItemDAO.find(scs));
		rs.setRecordCount(logicProSuggestItemDAO.count(scs));
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		return logicProSuggestItemDAO.deleteLogicProSuggestItemDOByPrimaryKey(id);
	}

	@Override
	public Integer update(LogicProSuggestItemDO t, User user) throws SyBaseException {
		t.setDuuser(user.getName());
		t.setDutime(new Date());
		return logicProSuggestItemDAO.updateLogicProSuggestItemDO(t);
	}

	@Override
	public LogicProSuggestItemDO save(LogicProSuggestItemDO t, User user)
			throws SyBaseException {
//		t.setDcruser(user.getName());
//		t.setDctime(new Date());
		logicProSuggestItemDAO.insertLogicProSuggestItemDO(t);
		return null;
	}

	@Override
	public LogicProSuggestItemDO findListById(String id) throws SyBaseException {
		return logicProSuggestItemDAO.findLogicProSuggestItemDOByPrimaryKey(id);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

}
